Skip to content

Commit

Permalink
Merge pull request #109 from godaddy/AsyncAwait
Browse files Browse the repository at this point in the history
Add async/await support and reorganize
  • Loading branch information
jgowdy-godaddy authored May 11, 2024
2 parents 4c4c9d3 + bd11e97 commit e7b5c56
Show file tree
Hide file tree
Showing 30 changed files with 3,942 additions and 5,568 deletions.
10 changes: 9 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
root = true

[*]
[src/*.{cc,h}]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{src,test}/*.{ts,json,js}]
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: Publish Asherah-Node
on:
release:
types: [published] # Trigger when release is created

jobs:
publish-package:
timeout-minutes: 15
runs-on: ubuntu-latest
container:
image: node:bullseye
image: node:bookworm
options: --ulimit core=-1 --ulimit memlock=-1:-1
steps:
- uses: actions/checkout@v2
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
MYSQL_DATABASE: testdb
MYSQL_USERNAME: root
MYSQL_PASSWORD: Password123

jobs:
test-package:
timeout-minutes: 15
Expand All @@ -21,12 +21,12 @@ jobs:
image: mysql:5.7
env:
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_PASSWORD }}
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_PASSWORD }}
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10
container:
image: node:bullseye
image: node:bookworm
options: --ulimit core=-1 --ulimit memlock=-1:-1
steps:
- uses: actions/checkout@v4
Expand All @@ -45,10 +45,10 @@ jobs:
PRIMARY KEY (id, created),
INDEX (created)
);"
- name: Set up Go
uses: actions/setup-go@v2
- name: Setup Go environment
uses: actions/setup-go@v5.0.1
with:
go-version: 1.20.7
go-version: 1.22.3
- name: Test Cross-Language
env:
TEST_DB_NAME: ${{ env.MYSQL_DATABASE }}
Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

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

2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 20.8.0
nodejs 22.1.0
27 changes: 27 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/src/**",
"${workspaceFolder}/node_modules/node-addon-api/**",
"${workspaceFolder}/node_modules/node-api-headers/include/**",
"${workspaceFolder}/lib/**"
],
"forcedInclude": [
"${workspaceFolder}/node_modules/node-addon-api/napi.h",
"${workspaceFolder}/lib/libasherah.h",
"${workspaceFolder}/node_modules/node-api-headers/include/node_api.h"
],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "macos-clang-arm64"
}
],
"version": 4
}
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
"variant": "cpp",
"vector": "cpp",
"algorithm": "cpp",
"format": "cpp"
"format": "cpp",
"execution": "cpp",
"__memory": "cpp"
}
}
21 changes: 10 additions & 11 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
'targets': [
{
'target_name': 'asherah',
'include_dirs': ["<!(node -p \"require('node-addon-api').include_dir\")"],
"cflags": ["-fexceptions", "-g", "-O3", "-std=c++17", "-fPIC"],
"cflags_cc": ["-fexceptions", "-g", "-O3", "-std=c++17", "-fPIC"],
'include_dirs': ["<!(node -p \"require('node-addon-api').include_dir\")", "lib/", "src/"],
"cflags": ["-fexceptions", "-g", "-O3", "-std=c++17", "-fPIC", "-Wno-unknown-pragmas"],
"cflags_cc": ["-fexceptions", "-g", "-O3", "-std=c++17", "-fPIC", "-Wno-unknown-pragmas"],
"cflags!": [ "-fno-exceptions"],
"cflags_cc!": [ "-fno-exceptions" ],
'xcode_settings': {
Expand All @@ -17,17 +17,16 @@
'-fPIC'
],
},
'defines': [ 'NAPI_CPP_EXCEPTIONS', 'NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS', 'NODE_ADDON_API_DISABLE_DEPRECATED', 'NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED' ],
'defines': [
'NAPI_CPP_EXCEPTIONS',
'NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS',
'NODE_ADDON_API_DISABLE_DEPRECATED',
'NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED'
],
'sources': [
'lib/libasherah.h',
'src/asherah.h',
'src/asherah.cc',
'src/logging.cc',
'src/logging.h',
'src/cobhan_napi_interop.h',
'src/cobhan.h',
'src/cobhan.cc',
'src/hints.h'
'src/logging_napi.cc'
],
'libraries': [ '../lib/libasherah.a' ]
}
Expand Down
Loading

0 comments on commit e7b5c56

Please sign in to comment.