bun-image-turbo 1.4.0 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -47,7 +47,9 @@ module.exports = __toCommonJS(index_exports);
47
47
  var import_fs = require("fs");
48
48
  var import_path = require("path");
49
49
  var import_url = require("url");
50
+ var import_module = require("module");
50
51
  var import_meta = {};
52
+ var nativeRequire = typeof import_meta?.url === "string" ? (0, import_module.createRequire)(import_meta.url) : typeof require !== "undefined" ? require : null;
51
53
  function getCurrentDir() {
52
54
  try {
53
55
  return (0, import_path.dirname)((0, import_url.fileURLToPath)(import_meta.url));
@@ -93,14 +95,14 @@ function loadNativeBinding() {
93
95
  for (const modulePath of possiblePaths) {
94
96
  try {
95
97
  if ((0, import_fs.existsSync)(modulePath)) {
96
- return require(modulePath);
98
+ return nativeRequire(modulePath);
97
99
  }
98
100
  } catch {
99
101
  continue;
100
102
  }
101
103
  }
102
104
  try {
103
- return require(optionalPackageName);
105
+ return nativeRequire(optionalPackageName);
104
106
  } catch {
105
107
  }
106
108
  throw new Error(
package/dist/index.mjs CHANGED
@@ -9,6 +9,8 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
9
9
  import { existsSync } from "fs";
10
10
  import { join, dirname } from "path";
11
11
  import { fileURLToPath } from "url";
12
+ import { createRequire } from "module";
13
+ var nativeRequire = typeof import.meta?.url === "string" ? createRequire(import.meta.url) : typeof __require !== "undefined" ? __require : null;
12
14
  function getCurrentDir() {
13
15
  try {
14
16
  return dirname(fileURLToPath(import.meta.url));
@@ -54,14 +56,14 @@ function loadNativeBinding() {
54
56
  for (const modulePath of possiblePaths) {
55
57
  try {
56
58
  if (existsSync(modulePath)) {
57
- return __require(modulePath);
59
+ return nativeRequire(modulePath);
58
60
  }
59
61
  } catch {
60
62
  continue;
61
63
  }
62
64
  }
63
65
  try {
64
- return __require(optionalPackageName);
66
+ return nativeRequire(optionalPackageName);
65
67
  } catch {
66
68
  }
67
69
  throw new Error(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun-image-turbo",
3
- "version": "1.4.0",
3
+ "version": "1.4.5",
4
4
  "author": "Aissam Irhir <aissamirhir@gmail.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -65,13 +65,13 @@
65
65
  ],
66
66
  "license": "MIT",
67
67
  "optionalDependencies": {
68
- "bun-image-turbo-darwin-arm64": "1.4.0",
69
- "bun-image-turbo-darwin-x64": "1.4.0",
70
- "bun-image-turbo-linux-arm64-gnu": "1.4.0",
71
- "bun-image-turbo-linux-x64-gnu": "1.4.0",
72
- "bun-image-turbo-linux-x64-musl": "1.4.0",
73
- "bun-image-turbo-win32-arm64-msvc": "1.4.0",
74
- "bun-image-turbo-win32-x64-msvc": "1.4.0"
68
+ "bun-image-turbo-darwin-arm64": "1.4.5",
69
+ "bun-image-turbo-darwin-x64": "1.4.5",
70
+ "bun-image-turbo-linux-arm64-gnu": "1.4.5",
71
+ "bun-image-turbo-linux-x64-gnu": "1.4.5",
72
+ "bun-image-turbo-linux-x64-musl": "1.4.5",
73
+ "bun-image-turbo-win32-arm64-msvc": "1.4.5",
74
+ "bun-image-turbo-win32-x64-msvc": "1.4.5"
75
75
  },
76
76
  "napi": {
77
77
  "name": "image-turbo",
@@ -94,7 +94,14 @@
94
94
  "build:all": "bun run build && bun run build:ts",
95
95
  "artifacts": "napi artifacts",
96
96
  "version": "napi version",
97
- "test": "bun test",
97
+ "test": "bun test test/local",
98
+ "test:local": "bun test test/local",
99
+ "test:bun": "cd test/packages/bun && bun install && bun test",
100
+ "test:npm": "cd test/packages/npm && npm install && npm test",
101
+ "test:yarn": "cd test/packages/yarn && yarn install && yarn test",
102
+ "test:pnpm": "cd test/packages/pnpm && pnpm install && pnpm test",
103
+ "test:packages": "bun run test:bun && bun run test:npm && bun run test:yarn && bun run test:pnpm",
104
+ "test:all": "bun run test:local && bun run test:packages",
98
105
  "bench": "bun run benchmarks/bench.ts",
99
106
  "lint": "eslint src",
100
107
  "clean": "rm -rf dist *.node npm"