@veryfront/ext-bundler-esbuild 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.
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 = {
@@ -1,4 +1,12 @@
1
1
  import type { BuildContext, BundleOptions, Bundler, BundleResult, TransformOptions, TransformResult } from "veryfront/extensions/bundler";
2
+ import type { ChildProcess } from "node:child_process";
3
+ /**
4
+ * Keep lifecycle tracking tolerant of Node-compatible child-process shims.
5
+ *
6
+ * Native Node represents an active child with `null` exit fields. Some
7
+ * compatible runtimes leave those fields undefined until the child exits.
8
+ */
9
+ export declare function isLiveEsbuildServiceProcess(child: Pick<ChildProcess, "killed" | "exitCode" | "signalCode">): boolean;
2
10
  /**
3
11
  * esbuild-backed {@link Bundler} implementation.
4
12
  *
@@ -1 +1 @@
1
- {"version":3,"file":"esbuild-bundler.d.ts","sourceRoot":"","sources":["../src/esbuild-bundler.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EAEb,OAAO,EACP,YAAY,EAGZ,gBAAgB,EAChB,eAAe,EAChB,MAAM,8BAA8B,CAAC;AA0TtC;;;;;GAKG;AACH,qBAAa,cAAe,YAAW,OAAO;IACtC,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAsCrD,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAa9D,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAqCtD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAiF5B"}
1
+ {"version":3,"file":"esbuild-bundler.d.ts","sourceRoot":"","sources":["../src/esbuild-bundler.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EAEb,OAAO,EACP,YAAY,EAGZ,gBAAgB,EAChB,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA+LvD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAC,GAC9D,OAAO,CAIT;AAwHD;;;;;GAKG;AACH,qBAAa,cAAe,YAAW,OAAO;IACtC,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAsCrD,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAa9D,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAqCtD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAiF5B"}
@@ -157,10 +157,19 @@ function isEsbuildServiceSpawn(spawnArgs) {
157
157
  args.some((arg) => typeof arg === "string" && arg.startsWith("--service=")) &&
158
158
  args.includes("--ping");
159
159
  }
160
+ /**
161
+ * Keep lifecycle tracking tolerant of Node-compatible child-process shims.
162
+ *
163
+ * Native Node represents an active child with `null` exit fields. Some
164
+ * compatible runtimes leave those fields undefined until the child exits.
165
+ */
166
+ export function isLiveEsbuildServiceProcess(child) {
167
+ return !child.killed &&
168
+ (child.exitCode === null || child.exitCode === undefined) &&
169
+ (child.signalCode === null || child.signalCode === undefined);
170
+ }
160
171
  function isLiveService(service) {
161
- return !service.child.killed &&
162
- service.child.exitCode === null &&
163
- service.child.signalCode === null;
172
+ return isLiveEsbuildServiceProcess(service.child);
164
173
  }
165
174
  function invokeEsbuild(operation) {
166
175
  const originalSpawn = childProcess.spawn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veryfront/ext-bundler-esbuild",
3
- "version": "0.1.1233",
3
+ "version": "0.1.1235",
4
4
  "description": "Veryfront first-party extension package for ext-bundler-esbuild",
5
5
  "keywords": [
6
6
  "veryfront",
@@ -50,7 +50,7 @@
50
50
  "esbuild": "0.28.1"
51
51
  },
52
52
  "peerDependencies": {
53
- "veryfront": "^0.1.1233"
53
+ "veryfront": "^0.1.1235"
54
54
  },
55
55
  "type": "module",
56
56
  "types": "./esm/index.d.ts",