2 Commits

Author SHA1 Message Date
dcb88ef4b5 v1.1.2
Some checks failed
Default (tags) / security (push) Successful in 39s
Default (tags) / test (push) Failing after 3m58s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2026-02-10 22:21:18 +00:00
6e4947ef7d fix(rust-binary-locator): use import.meta.resolve and url.fileURLToPath to locate bundled Rust binary in ESM environments 2026-02-10 22:21:17 +00:00
5 changed files with 13 additions and 4 deletions

View File

@@ -1,5 +1,12 @@
# Changelog # Changelog
## 2026-02-10 - 1.1.2 - fix(rust-binary-locator)
use import.meta.resolve and url.fileURLToPath to locate bundled Rust binary in ESM environments
- Replace require.resolve with import.meta.resolve to support ESM module resolution
- Convert resolved file URL to a filesystem path using url.fileURLToPath
- Export the url module from ts/plugins to provide fileURLToPath
## 2026-02-10 - 1.1.1 - fix(readme) ## 2026-02-10 - 1.1.1 - fix(readme)
update README with comprehensive documentation, usage examples, API reference, installation instructions, and legal/company information update README with comprehensive documentation, usage examples, API reference, installation instructions, and legal/company information

View File

@@ -1,6 +1,6 @@
{ {
"name": "@push.rocks/smartrust", "name": "@push.rocks/smartrust",
"version": "1.1.1", "version": "1.1.2",
"private": false, "private": false,
"description": "a bridge between JS engines and rust", "description": "a bridge between JS engines and rust",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartrust', name: '@push.rocks/smartrust',
version: '1.1.1', version: '1.1.2',
description: 'a bridge between JS engines and rust' description: 'a bridge between JS engines and rust'
} }

View File

@@ -108,7 +108,8 @@ export class RustBinaryLocator {
const packageName = `${platformPackagePrefix}-${platform}-${arch}`; const packageName = `${platformPackagePrefix}-${platform}-${arch}`;
try { try {
const packagePath = require.resolve(`${packageName}/${binaryName}`); const resolved = import.meta.resolve(`${packageName}/${binaryName}`);
const packagePath = plugins.url.fileURLToPath(resolved);
if (await this.isExecutable(packagePath)) { if (await this.isExecutable(packagePath)) {
return packagePath; return packagePath;
} }

View File

@@ -4,8 +4,9 @@ import * as fs from 'fs';
import * as childProcess from 'child_process'; import * as childProcess from 'child_process';
import * as readline from 'readline'; import * as readline from 'readline';
import * as events from 'events'; import * as events from 'events';
import * as url from 'url';
export { path, fs, childProcess, readline, events }; export { path, fs, childProcess, readline, events, url };
// @push.rocks scope // @push.rocks scope
import * as smartpath from '@push.rocks/smartpath'; import * as smartpath from '@push.rocks/smartpath';