Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@
'./src/rcl_timer_bindings.cpp',
'./src/rcl_utilities.cpp',
'./src/shadow_node.cpp',
'./third_party/ref-napi/src/ref_napi_bindings.cpp',
],
'include_dirs': [
'.',
'./third_party/ref-napi/src',
'<(ros_include_root)',
"<!@(node -p \"require('node-addon-api').include\")",
],
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
},
"dependencies": {
"@rclnodejs/ref-array-di": "^1.2.2",
"@rclnodejs/ref-napi": "^4.0.0",
"@rclnodejs/ref-struct-di": "^1.1.1",
"bindings": "^1.5.0",
"compare-versions": "^6.1.1",
Expand Down
2 changes: 1 addition & 1 deletion rosidl_gen/primitive_types.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const ref = require('@rclnodejs/ref-napi');
const ref = require('../third_party/ref-napi');
const StructType = require('@rclnodejs/ref-struct-di')(ref);
const rclnodejs = require('bindings')('rclnodejs');

Expand Down
2 changes: 1 addition & 1 deletion rosidl_gen/templates/message.dot
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function extractMemberNames(fields) {
{{? willUseTypedArray}}
const rclnodejs = require('bindings')('rclnodejs');
{{?}}
const ref = require('@rclnodejs/ref-napi');
const ref = require('../../third_party/ref-napi');
const StructType = require('@rclnodejs/ref-struct-di')(ref);
const ArrayType = require('@rclnodejs/ref-array-di')(ref);
const primitiveTypes = require('../../rosidl_gen/primitive_types.js');
Expand Down
3 changes: 3 additions & 0 deletions src/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "rcl_type_description_service_bindings.h"
#endif
#include "rcl_utilities.h"
#include "ref_napi_bindings.h"
#include "shadow_node.h"

bool IsRunningInElectronRenderer(const Napi::Env& env) {
Expand Down Expand Up @@ -93,6 +94,8 @@ Napi::Object InitModule(Napi::Env env, Napi::Object exports) {
rclnodejs::ShadowNode::Init(env, exports);
rclnodejs::RclHandle::Init(env, exports);

exports.Set("ref", rclnodejs::InitRefNapi(env));

#ifdef DEBUG_ON
int result = rcutils_logging_set_logger_level(PACKAGE_NAME,
RCUTILS_LOG_SEVERITY_DEBUG);
Expand Down
15 changes: 15 additions & 0 deletions third_party/ref-napi/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2025, The Robot Web Tools Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

module.exports = require('./lib/ref');
Loading
Loading