Skip to content

Commit

Permalink
Fixes (#39)
Browse files Browse the repository at this point in the history
* Fixes

* Fix CI

* fixup

* fixup

* fixup

* remove npm lockfile

* change artifact resolving (#40)

* Revert "change artifact resolving (#40)"

This reverts commit 03b64ff.

* attempt fix

* CI fixes

* CI fixes

* attempt fix ci

* try fix ci

* no need for pnpx

* npx?

* attempt fix

* attempt fix

* Revert "attempt fix"

This reverts commit 6c7e5a9.

* attempt fix

* fixup

* fixup

---------

Co-authored-by: Julian <[email protected]>
  • Loading branch information
kearfy and macjuul authored Aug 2, 2024
1 parent 0080766 commit 041dafa
Show file tree
Hide file tree
Showing 17 changed files with 2,020 additions and 5,821 deletions.
1,115 changes: 568 additions & 547 deletions .github/workflows/CI.yml

Large diffs are not rendered by default.

15 changes: 2 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ Temporary Items
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
Expand Down Expand Up @@ -106,9 +104,6 @@ typings/
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
Expand Down Expand Up @@ -158,7 +153,7 @@ dist
.AppleDouble
.LSOverride

# Icon must end with two
# Icon must end with two
Icon


Expand Down Expand Up @@ -223,16 +218,10 @@ $RECYCLE.BIN/
/target

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

*.node

examples
.idea
lib/*
test.skv
test.skv
4 changes: 1 addition & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ npm
.eslintrc
.prettierignore
rustfmt.toml
yarn.lock
*.node
.yarn
__test__
renovate.json
examples
examples
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.3.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
napi build --platform --release $@
echo -e "import { ConnectionOptions } from \"./lib-src/embedded.js\";\n$(cat index.d.ts)" > index.d.ts
1 change: 0 additions & 1 deletion fix-deps.sh

This file was deleted.

4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ConnectionOptions } from "./lib-src/types.js";
import { ConnectionOptions } from "./lib-src/embedded.js";
/* tslint:disable */
/* eslint-disable */

/* auto-generated by NAPI-RS */

export class SurrealdbNodeEngine {
export declare class SurrealdbNodeEngine {
execute(data: Uint8Array): Promise<Uint8Array>
static connect(endpoint: string, opts?: ConnectionOptions): Promise<SurrealdbNodeEngine>
free(): Promise<void>
Expand Down
64 changes: 61 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,72 @@ switch (platform) {
}
break
case 'arm':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'surrealdb.node.linux-arm-musleabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./surrealdb.node.linux-arm-musleabihf.node')
} else {
nativeBinding = require('surrealdb.node-linux-arm-musleabihf')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'surrealdb.node.linux-arm-gnueabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./surrealdb.node.linux-arm-gnueabihf.node')
} else {
nativeBinding = require('surrealdb.node-linux-arm-gnueabihf')
}
} catch (e) {
loadError = e
}
}
break
case 'riscv64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'surrealdb.node.linux-riscv64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./surrealdb.node.linux-riscv64-musl.node')
} else {
nativeBinding = require('surrealdb.node-linux-riscv64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'surrealdb.node.linux-riscv64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./surrealdb.node.linux-riscv64-gnu.node')
} else {
nativeBinding = require('surrealdb.node-linux-riscv64-gnu')
}
} catch (e) {
loadError = e
}
}
break
case 's390x':
localFileExisted = existsSync(
join(__dirname, 'surrealdb.node.linux-arm-gnueabihf.node')
join(__dirname, 'surrealdb.node.linux-s390x-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./surrealdb.node.linux-arm-gnueabihf.node')
nativeBinding = require('./surrealdb.node.linux-s390x-gnu.node')
} else {
nativeBinding = require('surrealdb.node-linux-arm-gnueabihf')
nativeBinding = require('surrealdb.node-linux-s390x-gnu')
}
} catch (e) {
loadError = e
Expand Down
Loading

0 comments on commit 041dafa

Please sign in to comment.