@polka-codes/cli-shared 0.9.90 → 0.9.91
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 +19 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -67433,6 +67433,7 @@ import { randomUUID } from "node:crypto";
|
|
|
67433
67433
|
import { existsSync as existsSync3 } from "node:fs";
|
|
67434
67434
|
import { mkdir as mkdir2, readFile as readFile3, rename as rename2, writeFile as writeFile2 } from "node:fs/promises";
|
|
67435
67435
|
import { dirname as dirname3, resolve as resolve5 } from "node:path";
|
|
67436
|
+
import { fileURLToPath } from "node:url";
|
|
67436
67437
|
var import_sql = __toESM(require_sql_wasm(), 1);
|
|
67437
67438
|
|
|
67438
67439
|
class FileLock {
|
|
@@ -67542,7 +67543,24 @@ async function getSqlJs() {
|
|
|
67542
67543
|
if (SqlJsInitPromise) {
|
|
67543
67544
|
return SqlJsInitPromise;
|
|
67544
67545
|
}
|
|
67545
|
-
|
|
67546
|
+
const moduleDir = dirname3(fileURLToPath(import.meta.url));
|
|
67547
|
+
const candidates = [
|
|
67548
|
+
resolve5(moduleDir, "sql-wasm.wasm"),
|
|
67549
|
+
resolve5(moduleDir, "..", "dist", "sql-wasm.wasm"),
|
|
67550
|
+
resolve5(moduleDir, "..", "node_modules", "sql.js", "dist", "sql-wasm.wasm"),
|
|
67551
|
+
resolve5(moduleDir, "..", "..", "..", "node_modules", "sql.js", "dist", "sql-wasm.wasm"),
|
|
67552
|
+
resolve5(process.cwd(), "node_modules", "sql.js", "dist", "sql-wasm.wasm")
|
|
67553
|
+
];
|
|
67554
|
+
SqlJsInitPromise = import_sql.default({
|
|
67555
|
+
locateFile: (file2) => {
|
|
67556
|
+
for (const candidate of candidates) {
|
|
67557
|
+
if (existsSync3(candidate)) {
|
|
67558
|
+
return candidate;
|
|
67559
|
+
}
|
|
67560
|
+
}
|
|
67561
|
+
return file2;
|
|
67562
|
+
}
|
|
67563
|
+
});
|
|
67546
67564
|
SqlJs = await SqlJsInitPromise;
|
|
67547
67565
|
return SqlJs;
|
|
67548
67566
|
}
|