@veryfront/ext-db-sqlite 0.1.1233 → 0.1.1235

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/esm/_dnt.shims.js +19 -4
  2. package/package.json +2 -2
package/esm/_dnt.shims.js CHANGED
@@ -1,14 +1,29 @@
1
- import { Deno as dntShimDeno } from "@deno/shim-deno";
2
1
  const dntNativeDeno = globalThis.Deno;
3
2
  // Prefer the host runtime's own Deno. The `@deno/shim-deno` fallback exists
4
3
  // for Node and Bun; under Deno it shadows working native APIs with node:net
5
4
  // reimplementations that throw (e.g. Deno.listen reads `server._handle.fd`,
6
5
  // which is null on Deno's node compatibility layer).
6
+ //
7
+ // It loads lazily so Deno never resolves it at all. The esm transform
8
+ // rewrites the bare specifier to an absolute file:// bundle, and Deno
9
+ // refuses to prepare that graph node when node_modules is unmanaged, which
10
+ // is what `deno install -g` produces (`nodeModulesDir: "manual"`). A static
11
+ // import therefore failed every request with "Loading unprepared module"
12
+ // naming a bundle that was present on disk, on the one runtime that never
13
+ // reads the value.
7
14
  export const Deno = typeof dntNativeDeno?.version?.deno === "string"
8
15
  ? dntNativeDeno
9
- : dntShimDeno;
10
- import { crypto } from "@deno/shim-crypto";
11
- export { crypto } from "@deno/shim-crypto";
16
+ : (await import("@deno/shim-deno")).Deno;
17
+ const dntNativeCrypto = globalThis.crypto;
18
+ // Web Crypto is a global on every runtime the framework supports (Deno,
19
+ // Node 19+, Bun), so `@deno/shim-crypto` is a fallback for runtimes that no
20
+ // longer exist in practice. It loads lazily for the same reason the Deno
21
+ // shim does: the esm transform rewrites the bare specifier to an absolute
22
+ // file:// bundle, and Deno cannot prepare that graph node when node_modules
23
+ // is unmanaged.
24
+ export const crypto = dntNativeCrypto !== undefined
25
+ ? dntNativeCrypto
26
+ : (await import("@deno/shim-crypto")).crypto;
12
27
  import { setInterval, setTimeout } from "@deno/shim-timers";
13
28
  export { setInterval, setTimeout } from "@deno/shim-timers";
14
29
  const dntGlobals = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veryfront/ext-db-sqlite",
3
- "version": "0.1.1233",
3
+ "version": "0.1.1235",
4
4
  "description": "Veryfront first-party extension package for ext-db-sqlite",
5
5
  "keywords": [
6
6
  "veryfront",
@@ -56,7 +56,7 @@
56
56
  "better-sqlite3": "13.0.3"
57
57
  },
58
58
  "peerDependencies": {
59
- "veryfront": "^0.1.1233"
59
+ "veryfront": "^0.1.1235"
60
60
  },
61
61
  "type": "module",
62
62
  "types": "./esm/extensions/ext-db-sqlite/src/index.d.ts",