-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add napi-header to third-party packages (#382)
* feat: add napi-header to third-party packages * fix: refine codes --------- Co-authored-by: Hu Yueh-Wei <[email protected]>
- Loading branch information
Showing
42 changed files
with
2,858 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
core/include_internal/ten_runtime/binding/nodejs/app/app.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// Copyright © 2024 Agora | ||
// This file is part of TEN Framework, an open source project. | ||
// Licensed under the Apache License, Version 2.0, with certain conditions. | ||
// Refer to the "LICENSE" file in the root directory for more information. | ||
// | ||
#include "ten_runtime/ten_config.h" | ||
|
||
#include "include_internal/ten_runtime/binding/nodejs/common/nodejs_stuff.h" | ||
|
||
TEN_RUNTIME_API napi_value ten_nodejs_app_module_init(napi_env env, | ||
napi_value exports); |
9 changes: 9 additions & 0 deletions
9
core/include_internal/ten_runtime/binding/nodejs/common/common.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// | ||
// Copyright © 2024 Agora | ||
// This file is part of TEN Framework, an open source project. | ||
// Licensed under the Apache License, Version 2.0, with certain conditions. | ||
// Refer to the "LICENSE" file in the root directory for more information. | ||
// | ||
#pragma once | ||
|
||
#include "include_internal/ten_runtime/binding/nodejs/common/nodejs_stuff.h" |
9 changes: 9 additions & 0 deletions
9
core/include_internal/ten_runtime/binding/nodejs/common/nodejs_stuff.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// | ||
// Copyright © 2024 Agora | ||
// This file is part of TEN Framework, an open source project. | ||
// Licensed under the Apache License, Version 2.0, with certain conditions. | ||
// Refer to the "LICENSE" file in the root directory for more information. | ||
// | ||
#pragma once | ||
|
||
#include <node_api.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# | ||
# Copyright © 2024 Agora | ||
# This file is part of TEN Framework, an open source project. | ||
# Licensed under the Apache License, Version 2.0, with certain conditions. | ||
# Refer to the "LICENSE" file in the root directory for more information. | ||
# | ||
import("//build/feature/ten_package.gni") | ||
import("//build/options.gni") | ||
import("//build/ten_runtime/feature/publish.gni") | ||
import("//build/ten_runtime/options.gni") | ||
import("//build/ten_runtime/ten.gni") | ||
import("//core/src/ten_runtime/output_libs.gni") | ||
|
||
ten_package("ten_nodejs_binding_system_package") { | ||
package_kind = "system" | ||
package_output_root_dir_name = "ten_runtime_nodejs" | ||
|
||
resources = [ | ||
"//core/src/ten_runtime/binding/nodejs/interface=>interface", | ||
"manifest.json", | ||
] | ||
|
||
foreach(lib, ten_runtime_nodejs_output_libs) { | ||
libname = get_path_info(rebase_path(lib), "file") | ||
resources += [ "${lib}=>lib/${libname}" ] | ||
} | ||
|
||
deps = [ "native:ten_runtime_nodejs" ] | ||
} | ||
|
||
if (ten_enable_package_manager) { | ||
ten_package_publish("upload_ten_nodejs_binding_system_package_to_server") { | ||
base_dir = | ||
rebase_path("${root_out_dir}/ten_packages/system/ten_runtime_nodejs") | ||
deps = [ | ||
":ten_nodejs_binding_system_package", | ||
"native:ten_runtime_nodejs", | ||
] | ||
} | ||
} | ||
|
||
group("nodejs") { | ||
deps = [ "native:ten_runtime_nodejs" ] | ||
|
||
if (ten_enable_package_manager) { | ||
deps += [ ":upload_ten_nodejs_binding_system_package_to_server" ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// | ||
// Copyright © 2024 Agora | ||
// This file is part of TEN Framework, an open source project. | ||
// Licensed under the Apache License, Version 2.0, with certain conditions. | ||
// Refer to the "LICENSE" file in the root directory for more information. | ||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"type": "system", | ||
"name": "ten_runtime_nodejs", | ||
"version": "0.4.2", | ||
"dependencies": [ | ||
{ | ||
"type": "system", | ||
"name": "ten_runtime", | ||
"version": "0.4.2" | ||
} | ||
], | ||
"package": { | ||
"include": [ | ||
"manifest.json", | ||
"BUILD.gn", | ||
"interface/**", | ||
"tools/**", | ||
"lib/**" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# | ||
# Copyright © 2024 Agora | ||
# This file is part of TEN Framework, an open source project. | ||
# Licensed under the Apache License, Version 2.0, with certain conditions. | ||
# Refer to the "LICENSE" file in the root directory for more information. | ||
# | ||
import("//build/ten_runtime/ten.gni") | ||
|
||
config("ten_runtime_nodejs_config") { | ||
include_dirs = ten_runtime_common_includes | ||
include_dirs += [ "//third_party/node-api-headers/include" ] | ||
|
||
if (!is_win) { | ||
cflags = [ "-fPIC" ] | ||
} | ||
} | ||
|
||
ten_shared_library("ten_runtime_nodejs") { | ||
configs = [ ":ten_runtime_nodejs_config" ] | ||
|
||
if (is_mac || is_linux) { | ||
add_configs = [ "//.gnfiles/build/toolchain/common:allow_undefined" ] | ||
remove_configs = [ "//.gnfiles/build/toolchain/common:disallow_undefined" ] | ||
} | ||
|
||
sources = [ | ||
"//core/src/ten_runtime/binding/nodejs/native/build_template/preserved_metadata.c", | ||
"init.c", | ||
] | ||
|
||
deps = [ | ||
"app", | ||
"//core/src/ten_runtime:ten_runtime_library", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Copyright © 2024 Agora | ||
# This file is part of TEN Framework, an open source project. | ||
# Licensed under the Apache License, Version 2.0, with certain conditions. | ||
# Refer to the "LICENSE" file in the root directory for more information. | ||
# | ||
import("//build/ten_runtime/glob.gni") | ||
|
||
glob("app") { | ||
configs = [ | ||
"//core/src/ten_runtime/binding/nodejs/native:ten_runtime_nodejs_config", | ||
] | ||
file_list = all_native_files | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Copyright © 2024 Agora | ||
// This file is part of TEN Framework, an open source project. | ||
// Licensed under the Apache License, Version 2.0, with certain conditions. | ||
// Refer to the "LICENSE" file in the root directory for more information. | ||
// | ||
#include "include_internal/ten_runtime/binding/nodejs/app/app.h" | ||
|
||
#include "include_internal/ten_runtime/binding/nodejs/common/common.h" | ||
|
||
napi_value ten_nodejs_app_module_init(napi_env env, napi_value exports) { | ||
return exports; | ||
} |
13 changes: 13 additions & 0 deletions
13
core/src/ten_runtime/binding/nodejs/native/build_template/preserved_metadata.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Copyright © 2024 Agora | ||
// This file is part of TEN Framework, an open source project. | ||
// Licensed under the Apache License, Version 2.0, with certain conditions. | ||
// Refer to the "LICENSE" file in the root directory for more information. | ||
// | ||
#include "include_internal/ten_runtime/common/preserved_metadata.h" | ||
|
||
static char metadata[] = "version=0.1.0"; | ||
|
||
void ten_preserved_metadata(void) { | ||
((char volatile *)metadata)[0] = metadata[0]; | ||
} |
13 changes: 13 additions & 0 deletions
13
core/src/ten_runtime/binding/nodejs/native/build_template/preserved_metadata.c.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Copyright © 2024 Agora | ||
// This file is part of TEN Framework, an open source project. | ||
// Licensed under the Apache License, Version 2.0, with certain conditions. | ||
// Refer to the "LICENSE" file in the root directory for more information. | ||
// | ||
#include "include_internal/ten_runtime/common/preserved_metadata.h" | ||
|
||
static char metadata[] = "version={{ VERSION }}"; | ||
|
||
void ten_preserved_metadata(void) { | ||
((char volatile *)metadata)[0] = metadata[0]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Copyright © 2024 Agora | ||
// This file is part of TEN Framework, an open source project. | ||
// Licensed under the Apache License, Version 2.0, with certain conditions. | ||
// Refer to the "LICENSE" file in the root directory for more information. | ||
// | ||
#include "include_internal/ten_runtime/binding/nodejs/app/app.h" | ||
#include "include_internal/ten_runtime/binding/nodejs/common/common.h" | ||
|
||
napi_value Init(napi_env env, napi_value exports) { | ||
ten_nodejs_app_module_init(env, exports); | ||
return exports; | ||
} | ||
|
||
NAPI_MODULE(ten_runtime_nodejs, Init) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.vscode | ||
node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
scripts/ | ||
.github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "1.4.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# node-api-headers Changelog | ||
|
||
## [1.4.0](https://github.com/nodejs/node-api-headers/compare/v1.3.0...v1.4.0) (2024-10-30) | ||
|
||
|
||
### Features | ||
|
||
* **no-release:** add conditional support in `#if` ([#52](https://github.com/nodejs/node-api-headers/issues/52)) ([e1b8feb](https://github.com/nodejs/node-api-headers/commit/e1b8feb060cf85522538ec1b8a1d6eb782620022)) | ||
* update headers from nodejs/node tag v23.1.0 ([#56](https://github.com/nodejs/node-api-headers/issues/56)) ([3336912](https://github.com/nodejs/node-api-headers/commit/33369124c7f8a670422a0c5a27ad149da83ed8d6)) | ||
|
||
## [1.3.0](https://github.com/nodejs/node-api-headers/compare/v1.2.0...v1.3.0) (2024-09-04) | ||
|
||
|
||
### Features | ||
|
||
* update headers from nodejs/node tag v22.7.0 ([#48](https://github.com/nodejs/node-api-headers/issues/48)) ([6c73c34](https://github.com/nodejs/node-api-headers/commit/6c73c34b72e836531530f863eac315bd42e4569e)) | ||
|
||
## [1.2.0](https://github.com/nodejs/node-api-headers/compare/node-api-headers-v1.1.0...node-api-headers-v1.2.0) (2024-07-09) | ||
|
||
|
||
### Features | ||
|
||
* update headers from nodejs/node tag v22.1.0 ([d5cfe19](https://github.com/nodejs/node-api-headers/commit/d5cfe19da8b974ca35764dd1c73b91d57cd3c4ce)) | ||
|
||
## 2023-08-05 Version 1.1.0, @NickNaso | ||
|
||
### Notable changes | ||
|
||
- Update headers from nodejs/node tag v20.3.0. | ||
|
||
### Commits | ||
|
||
- \[[`1f5a85dbb0`](https://github.com/nodejs/node-api-headers/commit/1f5a85dbb0)] - Update headers from nodejs/node tag v20.3.0 (#30) (github-actions\[bot]) | ||
|
||
## 2023-05-18 Version 1.0.1, @NickNaso | ||
|
||
### Notable changes | ||
|
||
- Update headers from nodejs/node tag v20.2.0. | ||
|
||
### Commits | ||
|
||
- \[[`d61451e6a3`](https://github.com/nodejs/node-api-headers/commit/d61451e6a3)] - Update headers from nodejs/node tag v20.2.0 (#27) (github-actions\[bot]) | ||
|
||
## 2023-04-20 Version 1.0.0, @NickNaso | ||
|
||
### Notable changes | ||
|
||
- Explain package version rationale. | ||
- Update headers from nodejs/node tag v19.9.0. | ||
|
||
### Commits | ||
|
||
- \[[`130338da33`](https://github.com/nodejs/node-api-headers/commit/130338da33)] - **doc**: explain package version rationale (#26) (Chengzhong Wu) | ||
- \[[`1a328031da`](https://github.com/nodejs/node-api-headers/commit/1a328031da)] - Update headers from nodejs/node tag v19.9.0 (#24) (github-actions\[bot]) | ||
|
||
## 2023-04-06 Version 0.0.5, @NickNaso | ||
|
||
### Notable changes | ||
|
||
- Provide def file for windows import lib. | ||
|
||
### Commits | ||
|
||
- \[[`15477c5898`](https://github.com/nodejs/node-api-headers/commit/15477c5898)] - Update headers from nodejs/node tag v19.8.1 (#22) (github-actions\[bot]) | ||
- \[[`d7fa23b60e`](https://github.com/nodejs/node-api-headers/commit/d7fa23b60e)] - Use git status instead of git diff for change calculation (#21) (Kevin Eady) | ||
- \[[`ea0dc01425`](https://github.com/nodejs/node-api-headers/commit/ea0dc01425)] - **fix**: moved def files on a proper folder. (#19) (Nicola Del Gobbo) | ||
- \[[`069c3eb6f8`](https://github.com/nodejs/node-api-headers/commit/069c3eb6f8)] - **doc**: how to create a new release. (#18) (Nicola Del Gobbo) | ||
- \[[`d23c2879c8`](https://github.com/nodejs/node-api-headers/commit/d23c2879c8)] - Provide def file for windows import lib (#17) (Leonid Pospelov) | ||
|
||
## 2023-03-17 Version 0.0.4, @NickNaso | ||
|
||
### Notable changes | ||
|
||
- Update headers from nodejs/node tag v19.8.0. | ||
|
||
### Commits | ||
|
||
- \[[`a1f0d41240`](https://github.com/nodejs/node-api-headers/commit/a1f0d41240)] - Merge pull request #14 from nodejs/update-headers/v19.8.0 (Nicola Del Gobbo) | ||
- \[[`7548267285`](https://github.com/nodejs/node-api-headers/commit/7548267285)] - Update headers from nodejs/node tag v19.8.0 (github-actions\[bot]) | ||
|
||
## 2023-03-08 Version 0.0.3, @NickNaso | ||
|
||
### Notable changes | ||
|
||
- Add helper scripts for updating headers and symbols.js. | ||
|
||
### Commits | ||
|
||
- \[[`4fdbdd1710`](https://github.com/nodejs/node-api-headers/commit/4fdbdd1710)] - Update headers from nodejs/node tag v19.6.0 (#9) (github-actions\[bot]) | ||
- \[[`ecefbdd00f`](https://github.com/nodejs/node-api-headers/commit/ecefbdd00f)] - Add helper scripts for updating headers and symbols.js (#7) (Kevin Eady) | ||
|
||
## 2022-12-29 Version 0.0.2, @NickNaso | ||
|
||
### Notable changes | ||
|
||
- Fixed wrong symblos in v6. | ||
|
||
### Commits | ||
|
||
- \[[`9c0b4ecaa5`](https://github.com/nodejs/node-api-headers/commit/9c0b4ecaa5)] - **fix**: wrong symblos in v6 (#6) (Nicola Del Gobbo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Code of Conduct | ||
|
||
The Node.js Code of Conduct, which applies to this project, can be found at | ||
https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md. |
Oops, something went wrong.