next-bun-compile 0.10.0 → 0.10.1

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/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  compile,
4
4
  generateEntryPoint
5
- } from "./index-d3wb5t4x.js";
5
+ } from "./index-hb6dh1nm.js";
6
6
 
7
7
  // src/cli.ts
8
8
  import { existsSync } from "node:fs";
@@ -46,10 +46,9 @@ function walkDir(dir, base = dir) {
46
46
  }
47
47
  return results;
48
48
  }
49
- function toVarName(filePath) {
50
- const hash = createHash("sha256").update(filePath).digest("hex").slice(0, 6);
49
+ function toVarName(filePath, index) {
51
50
  const safe = filePath.replace(/[^a-zA-Z0-9]/g, "_").slice(0, 40);
52
- return `asset_${safe}_${hash}`;
51
+ return `asset_${index}_${safe}`;
53
52
  }
54
53
  function findPackageDirs(standaloneDir, pkg) {
55
54
  const dirs = [];
@@ -560,8 +559,8 @@ function generateEntryPoint(options) {
560
559
  const buildHash = hasher.digest("hex");
561
560
  const imports = [];
562
561
  const mapEntries = [];
563
- for (const asset of assetsToEmbed) {
564
- const varName = toVarName(asset.urlPath);
562
+ for (const [i, asset] of assetsToEmbed.entries()) {
563
+ const varName = toVarName(asset.urlPath, i);
565
564
  const importPath = relative(serverDir, asset.absolutePath).replace(/\\/g, "/");
566
565
  imports.push(`import ${varName} from "./${importPath}" with { type: "file" };`);
567
566
  mapEntries.push(` ["${asset.urlPath}", ${varName}],`);
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  compile,
3
3
  generateEntryPoint
4
- } from "./index-d3wb5t4x.js";
4
+ } from "./index-hb6dh1nm.js";
5
5
  export {
6
6
  generateEntryPoint,
7
7
  compile
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-bun-compile",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Compile your Next.js app into a Bun single-file executable",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",