Skip to content

Commit

Permalink
Update to fix issues with includes in gyp
Browse files Browse the repository at this point in the history
  • Loading branch information
SurienDG committed Dec 21, 2020
1 parent d21ce59 commit 86e4f40
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- [NAPI-Thread-Safe-Promise](#napi-thread-safe-promise)
- [Introduction](#introduction)
- [Usage](#usage)
- [Exception handling](#exception-handling)
- [Exception handling](#exception-handling)
- [Examples](#examples)
- [Async Promise Example (with macro)](#async-promise-example-with-macro)
- [Async Promise Example (without using macro)](#async-promise-example-without-using-macro)
Expand Down Expand Up @@ -44,6 +44,8 @@ npm install napi_thread_safe_promise
#include "promiseWrapper.h"
```

**Note:** Currently latest node version has bugs with regards to gyp so use the latest stable version (should be `v14.15.3` as of now)

### Exception handling

To have the ability for exceptions add the following to `binding.gyp`:
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "napi_thread_safe_promise",
"version": "1.1.1",
"description": "C++ napi thread safe promises",
"version": "1.1.2",
"description": "C++ napi threadd safe promises",
"main": "build/index.js",
"scripts": {
"test": "npm run test-rebuild",
Expand All @@ -10,7 +10,6 @@
"test-clean": "node-gyp clean --directory test",
"prepare": "npm run build"
},
"gypfile": false,
"author": "Surien Das-Giwojno",
"license": "BSD-3-Clause",
"repository": {
Expand All @@ -25,11 +24,14 @@
"c++",
"node-addon-api"
],
"gypfile": false,
"dependencies": {
"node-addon-api": "^3.0.0"
},
"devDependencies": {
"@types/bindings": "^1.3.0",
"@types/node": "^13.13.5",
"bindings": "^1.5.0",
"node-addon-api": "^3.0.0",
"node-gyp": "^6.1.0",
"tslint": "^6.1.2",
"typescript": "^3.8.3"
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';

export const include = `"${__dirname}"/../src`;
export const gyp = path.join(__dirname, '/../binding.gyp:napi_thread_safe_promise');
export const include = path.relative('.',`${__dirname}/../src`);
export const gyp = path.join(include, '/../binding.gyp:napi_thread_safe_promise');

0 comments on commit 86e4f40

Please sign in to comment.