Skip to content

Commit

Permalink
feat: add node 19 support (#428)
Browse files Browse the repository at this point in the history
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
  • Loading branch information
favna and vladfrangu committed Dec 18, 2022
1 parent d836d9e commit f2d2dc6
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 30 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci-build-and-test.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11, macos-12, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019]
os: [macos-10.15, macos-11, macos-12, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022]
node: [12, 13, 14, 15, 16, 17]
steps:
- name: Checkout Project
Expand Down Expand Up @@ -48,8 +48,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11, macos-12, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [18]
os: [macos-10.15, macos-11, macos-12, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022]
node: [18, 19]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12, 13, 14, 15, 16, 17, 18]
node: [12, 13, 14, 15, 16, 17, 18, 19]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
node: [18]
node: [18, 19]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -197,7 +197,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12, 13, 14, 15, 16, 17, 18]
node: [12, 13, 14, 15, 16, 17, 18, 19]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
Expand Down
39 changes: 27 additions & 12 deletions .github/workflows/release-updater.yml
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11, macos-12, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019]
os: [macos-10.15, macos-11, macos-12, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022]
node: [12, 13, 14, 15, 16, 17]
steps:
- name: Checkout Project
Expand All @@ -30,7 +30,7 @@ jobs:
registry-url: https://registry.yarnpkg.org/

- name: Install Dependencies
run: yarn --immutable
run: yarn --immutable --mode=skip-build

- name: Package prebuild
run: yarn build
Expand All @@ -48,8 +48,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11, macos-12, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [18]
os: [macos-10.15, macos-11, macos-12, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022]
node: [18, 19]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -62,7 +62,10 @@ jobs:
registry-url: https://registry.yarnpkg.org/

- name: Install dependencies
run: yarn --immutable
run: yarn --immutable --mode=skip-build

- name: Build From Source
run: yarn gyp:build-from-source

- name: Package prebuild
run: yarn build
Expand All @@ -82,7 +85,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12, 13, 14, 15, 16, 17, 18]
node: [12, 13, 14, 15, 16, 17, 18, 19]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
Expand All @@ -93,7 +96,10 @@ jobs:
uses: actions/checkout@v3

- name: Install dependencies
run: yarn --immutable
run: yarn --immutable --mode=skip-build

- name: Build From Source
run: yarn gyp:build-from-source

- name: Package prebuild
run: yarn build
Expand Down Expand Up @@ -125,7 +131,10 @@ jobs:
registry-url: https://registry.yarnpkg.org/

- name: Install dependencies
run: yarn --immutable
run: yarn --immutable --mode=skip-build

- name: Build From Source
run: yarn gyp:build-from-source

- name: Package prebuild
run: |
Expand All @@ -150,7 +159,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
node: [18]
node: [18, 19]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -163,7 +172,10 @@ jobs:
registry-url: https://registry.yarnpkg.org/

- name: Install dependencies
run: yarn --immutable
run: yarn --immutable --mode=skip-build

- name: Build From Source
run: yarn gyp:build-from-source

- name: Package prebuild
run: |
Expand All @@ -189,7 +201,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12, 13, 14, 15, 16, 17, 18]
node: [12, 13, 14, 15, 16, 17, 18, 19]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
Expand All @@ -206,7 +218,10 @@ jobs:
$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc --version
- name: Install dependencies
run: yarn --immutable
run: yarn --immutable --mode=skip-build

- name: Build From Source
run: yarn gyp:build-from-source

- name: Package prebuild
run: |
Expand Down
8 changes: 0 additions & 8 deletions README.md
Expand Up @@ -15,14 +15,6 @@

---

**_Note: We currently do not support NodeJS version 19 and above. This is currently not possible because we're using the
[`nan`][nan] package for NodeJS internal bindings and [`nan`][nan] currently does not support NodeJS version 19 and
above._**

[nan]: https://github.com/nodejs/nan

---

**Table of Contents**

- [@sapphire/type](#sapphiretype)
Expand Down
6 changes: 5 additions & 1 deletion lib/type.cc
Expand Up @@ -45,7 +45,11 @@ void GetProxyDetails(const Nan::FunctionCallbackInfo<v8::Value>& args) {
}

void Init(v8::Local<v8::Object> exports) {
v8::Local<v8::Context> context = exports->CreationContext();
#if V8_MAJOR_VERSION >= 9
auto context = exports->GetCreationContext().ToLocalChecked();
#else
auto context = exports->CreationContext();
#endif

exports->Set(context, Nan::New("getPromiseDetails").ToLocalChecked(), Nan::New<v8::FunctionTemplate>(GetPromiseDetails)->GetFunction(context).ToLocalChecked());
exports->Set(context, Nan::New("getProxyDetails").ToLocalChecked(), Nan::New<v8::FunctionTemplate>(GetProxyDetails)->GetFunction(context).ToLocalChecked());
Expand Down
4 changes: 1 addition & 3 deletions src/index.ts
Expand Up @@ -9,9 +9,7 @@ declare namespace Internals {
const bindingPath = find(resolve(join(__dirname, '..', './package.json')));

// eslint-disable-next-line @typescript-eslint/no-var-requires
const binding = require(bindingPath);

export const { getPromiseDetails, getProxyDetails }: typeof Internals = binding;
export const { getPromiseDetails, getProxyDetails } = require(bindingPath) as typeof Internals;

/**
* The class for deep checking Types
Expand Down

0 comments on commit f2d2dc6

Please sign in to comment.