@polka-codes/cli-shared 0.11.1 → 0.11.3

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -797,6 +797,7 @@ import { AsyncLocalStorage } from "node:async_hooks";
797
797
  import { randomUUID } from "node:crypto";
798
798
  import { existsSync as existsSync3 } from "node:fs";
799
799
  import { mkdir as mkdir2, readdir, readFile as readFile3, rename as rename2, unlink as unlink2, writeFile as writeFile2 } from "node:fs/promises";
800
+ import { createRequire as createRequire2 } from "node:module";
800
801
  import { basename, dirname as dirname3, resolve as resolve4 } from "node:path";
801
802
  import { fileURLToPath } from "node:url";
802
803
  import { DEFAULT_MEMORY_CONFIG, resolveHomePath } from "@polka-codes/core";
@@ -947,8 +948,10 @@ class ReentrantMutex {
947
948
  }
948
949
  var SqlJs = null;
949
950
  var SqlJsInitPromise = null;
950
- var moduleDir = dirname3(fileURLToPath(import.meta.url));
951
- var bundledWasmPath = resolve4(moduleDir, "sql-wasm.wasm");
951
+ var moduleWasmPath = resolve4(dirname3(fileURLToPath(import.meta.url)), "sql-wasm.wasm");
952
+ var mainModulePath = createRequire2(import.meta.url).main?.filename;
953
+ var mainModuleWasmPath = mainModulePath ? resolve4(dirname3(mainModulePath), "sql-wasm.wasm") : null;
954
+ var bundledWasmPath = mainModuleWasmPath && existsSync3(mainModuleWasmPath) ? mainModuleWasmPath : moduleWasmPath;
952
955
  var hasBundledWasm = existsSync3(bundledWasmPath);
953
956
  async function getSqlJs() {
954
957
  if (SqlJs) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polka-codes/cli-shared",
3
- "version": "0.11.1",
3
+ "version": "0.11.3",
4
4
  "license": "AGPL-3.0",
5
5
  "author": "github@polka.codes",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "@ai-sdk/google-vertex": "^5.0.20",
30
30
  "@ai-sdk/provider": "^4.0.3",
31
31
  "@inquirer/prompts": "^8.5.2",
32
- "@polka-codes/core": "^0.11.1",
32
+ "@polka-codes/core": "^0.11.3",
33
33
  "ai": "^7.0.28",
34
34
  "chalk": "^5.6.2",
35
35
  "ignore": "^7.0.6",