Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ jobs:
gcc-aarch64-linux-gnu \
binfmt-support binutils binutils-aarch64-linux-gnu
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v1
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
Expand Down
7 changes: 3 additions & 4 deletions __test__/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* Copyright 2025 NetApp Inc. All Rights Reserved.
*
Expand All @@ -15,8 +16,6 @@
*
* SPDX-License-Identifier: Apache-2.0
*/

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Expand Down Expand Up @@ -1187,7 +1186,7 @@ ava_1.default.serial('should handle getting directories concurrently', async (t)
}
});
if (!node_process_1.default.env.TEST_USING_MOCKS) {
ava_1.default.serial('should handle watch', async (t) => {
ava_1.default.serial.skip('should handle watch', async (t) => {
const sleep = async (ms) => { return new Promise((resolve) => setTimeout(resolve, ms)); };
const rootHandle = await getRootHandle();
const smbHandle = rootHandle;
Expand Down Expand Up @@ -1242,7 +1241,7 @@ if (!node_process_1.default.env.TEST_USING_MOCKS) {
t.is(expectedIndex, expectedEntries.length);
watcher.cancel();
});
ava_1.default.serial('should handle watch on subdirectory', async (t) => {
ava_1.default.serial.skip('should handle watch on subdirectory', async (t) => {
const sleep = async (ms) => { return new Promise((resolve) => setTimeout(resolve, ms)); };
const rootHandle = await getRootHandle();
const subHandle = await rootHandle.getDirectoryHandle("subbed", { create: true });
Expand Down
4 changes: 2 additions & 2 deletions __test__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ test.serial('should handle getting directories concurrently', async (t) => {
})

if (!process.env.TEST_USING_MOCKS) {
test.serial('should handle watch', async (t) => {
test.serial.skip('should handle watch', async (t) => {
const sleep = async (ms: number) => { return new Promise((resolve) => setTimeout(resolve, ms)); };
const rootHandle = await getRootHandle();
const smbHandle = rootHandle as SmbDirectoryHandle;
Expand Down Expand Up @@ -1351,7 +1351,7 @@ if (!process.env.TEST_USING_MOCKS) {
watcher.cancel();
})

test.serial('should handle watch on subdirectory', async (t) => {
test.serial.skip('should handle watch on subdirectory', async (t) => {
const sleep = async (ms: number) => { return new Promise((resolve) => setTimeout(resolve, ms)); };
const rootHandle = await getRootHandle();
const subHandle = await rootHandle.getDirectoryHandle("subbed", {create: true});
Expand Down
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ if [ "$ARG1" == "test" ]; then
else
yarn build-tsc
yarn build-napi --target ${TARGET_TRIPLE}

# amend napi generated index.js a bit so that it plays nicer with esbuild
for x in `cat index.js | grep -o "smb-js\..*\.node" | sort | uniq`; do
cat index.js | sed "s/join(__dirname, '$x')/new URL('$x', import.meta.url)/g" > index.js~
mv index.js{~,}
done
fi

if [ "${NODE_OS}" == "darwin" ]; then
Expand Down
3 changes: 1 addition & 2 deletions indax.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* Copyright 2025 NetApp Inc. All Rights Reserved.
*
Expand All @@ -15,8 +16,6 @@
*
* SPDX-License-Identifier: Apache-2.0
*/

"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SmbWritableFileStream = exports.SmbFileHandle = exports.SmbDirectoryHandle = exports.SmbHandle = void 0;
Expand Down
36 changes: 18 additions & 18 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ switch (platform) {
case 'android':
switch (arch) {
case 'arm64':
localFileExisted = existsSync(join(__dirname, 'smb-js.android-arm64.node'))
localFileExisted = existsSync(new URL('smb-js.android-arm64.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.android-arm64.node')
Expand All @@ -44,7 +44,7 @@ switch (platform) {
}
break
case 'arm':
localFileExisted = existsSync(join(__dirname, 'smb-js.android-arm-eabi.node'))
localFileExisted = existsSync(new URL('smb-js.android-arm-eabi.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.android-arm-eabi.node')
Expand All @@ -62,7 +62,7 @@ switch (platform) {
case 'win32':
switch (arch) {
case 'x64':
localFileExisted = existsSync(join(__dirname, 'smb-js.win32-x64-msvc.node'))
localFileExisted = existsSync(new URL('smb-js.win32-x64-msvc.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.win32-x64-msvc.node')
Expand All @@ -74,7 +74,7 @@ switch (platform) {
}
break
case 'ia32':
localFileExisted = existsSync(join(__dirname, 'smb-js.win32-ia32-msvc.node'))
localFileExisted = existsSync(new URL('smb-js.win32-ia32-msvc.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.win32-ia32-msvc.node')
Expand All @@ -86,7 +86,7 @@ switch (platform) {
}
break
case 'arm64':
localFileExisted = existsSync(join(__dirname, 'smb-js.win32-arm64-msvc.node'))
localFileExisted = existsSync(new URL('smb-js.win32-arm64-msvc.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.win32-arm64-msvc.node')
Expand All @@ -102,7 +102,7 @@ switch (platform) {
}
break
case 'darwin':
localFileExisted = existsSync(join(__dirname, 'smb-js.darwin-universal.node'))
localFileExisted = existsSync(new URL('smb-js.darwin-universal.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.darwin-universal.node')
Expand All @@ -113,7 +113,7 @@ switch (platform) {
} catch {}
switch (arch) {
case 'x64':
localFileExisted = existsSync(join(__dirname, 'smb-js.darwin-x64.node'))
localFileExisted = existsSync(new URL('smb-js.darwin-x64.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.darwin-x64.node')
Expand All @@ -125,7 +125,7 @@ switch (platform) {
}
break
case 'arm64':
localFileExisted = existsSync(join(__dirname, 'smb-js.darwin-arm64.node'))
localFileExisted = existsSync(new URL('smb-js.darwin-arm64.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.darwin-arm64.node')
Expand All @@ -144,7 +144,7 @@ switch (platform) {
if (arch !== 'x64') {
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
}
localFileExisted = existsSync(join(__dirname, 'smb-js.freebsd-x64.node'))
localFileExisted = existsSync(new URL('smb-js.freebsd-x64.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.freebsd-x64.node')
Expand All @@ -159,7 +159,7 @@ switch (platform) {
switch (arch) {
case 'x64':
if (isMusl()) {
localFileExisted = existsSync(join(__dirname, 'smb-js.linux-x64-musl.node'))
localFileExisted = existsSync(new URL('smb-js.linux-x64-musl.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.linux-x64-musl.node')
Expand All @@ -170,7 +170,7 @@ switch (platform) {
loadError = e
}
} else {
localFileExisted = existsSync(join(__dirname, 'smb-js.linux-x64-gnu.node'))
localFileExisted = existsSync(new URL('smb-js.linux-x64-gnu.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.linux-x64-gnu.node')
Expand All @@ -184,7 +184,7 @@ switch (platform) {
break
case 'arm64':
if (isMusl()) {
localFileExisted = existsSync(join(__dirname, 'smb-js.linux-arm64-musl.node'))
localFileExisted = existsSync(new URL('smb-js.linux-arm64-musl.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.linux-arm64-musl.node')
Expand All @@ -195,7 +195,7 @@ switch (platform) {
loadError = e
}
} else {
localFileExisted = existsSync(join(__dirname, 'smb-js.linux-arm64-gnu.node'))
localFileExisted = existsSync(new URL('smb-js.linux-arm64-gnu.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.linux-arm64-gnu.node')
Expand All @@ -209,7 +209,7 @@ switch (platform) {
break
case 'arm':
if (isMusl()) {
localFileExisted = existsSync(join(__dirname, 'smb-js.linux-arm-musleabihf.node'))
localFileExisted = existsSync(new URL('smb-js.linux-arm-musleabihf.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.linux-arm-musleabihf.node')
Expand All @@ -220,7 +220,7 @@ switch (platform) {
loadError = e
}
} else {
localFileExisted = existsSync(join(__dirname, 'smb-js.linux-arm-gnueabihf.node'))
localFileExisted = existsSync(new URL('smb-js.linux-arm-gnueabihf.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.linux-arm-gnueabihf.node')
Expand All @@ -234,7 +234,7 @@ switch (platform) {
break
case 'riscv64':
if (isMusl()) {
localFileExisted = existsSync(join(__dirname, 'smb-js.linux-riscv64-musl.node'))
localFileExisted = existsSync(new URL('smb-js.linux-riscv64-musl.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.linux-riscv64-musl.node')
Expand All @@ -245,7 +245,7 @@ switch (platform) {
loadError = e
}
} else {
localFileExisted = existsSync(join(__dirname, 'smb-js.linux-riscv64-gnu.node'))
localFileExisted = existsSync(new URL('smb-js.linux-riscv64-gnu.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.linux-riscv64-gnu.node')
Expand All @@ -258,7 +258,7 @@ switch (platform) {
}
break
case 's390x':
localFileExisted = existsSync(join(__dirname, 'smb-js.linux-s390x-gnu.node'))
localFileExisted = existsSync(new URL('smb-js.linux-s390x-gnu.node', import.meta.url))
try {
if (localFileExisted) {
nativeBinding = require('./smb-js.linux-s390x-gnu.node')
Expand Down