@smoothbricks/nx-plugin 0.7.9 → 0.7.10

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/README.md CHANGED
@@ -1160,25 +1160,26 @@ Concrete targets come from concrete files:
1160
1160
  produced. The emit sets `TTSC_WRITE_IF_CHANGED=1`, with which ttsc writes an output only when its bytes differ (the
1161
1161
  managed ttsc patch), so an emit after one source edit leaves every output whose bytes did not change as it was, inode
1162
1162
  and mtime included: rewriting identical bytes is file churn that every copy-on-write clone of the checkout pays for.
1163
- The emit runs with `--verbose`, whose summary lists every file the emit produced on both of ttsc's lanes, and after a
1164
- successful emit the executor removes each file under `outDir` that the list does not name, other than its own
1165
- `.build-inputs.json`, and each directory that leaves empty. A file an earlier build wrote and this one no longer does
1166
- (a bin moved to another package, a deleted module) is gone before Nx captures the output, so no cache artifact carries
1167
- it. A summary that lists no files, or fewer or more than it counts, fails the emit rather than read as one that
1168
- produced nothing, and a list that names a file the emit did not leave prunes nothing and fails the emit, so Nx caches
1169
- no output it emptied. Execute bits are set only on a bin that lacks them, since a chmod moves the file's ctime even
1170
- when its mode stays. A failed emit removes nothing, and an `outDir` that holds a TypeScript source is refused before
1171
- the compiler runs. It writes `.build-inputs.json` into the `outDir`, only when the record changed: the SHA-256 of
1172
- every file the config's `include` matches less its `exclude`, taken before the emit, and those globs as Git pathspecs.
1173
- Native targets write the same record from rustc's dep-info through `@smoothbricks/build-inputs`: macOS uses its
1174
- `smoo-nx-build-inputs` CLI and Linux's `cargo-zigbuild` executor calls that same collector. A record produced under Nx
1175
- also carries its producer's project, target and optional configuration, taken from the actual task environment. Shell
1176
- entry uses that identity to judge the selected development receipts, including inferred targets absent from package
1177
- manifests, and name their actual cached rebuild. It constructs no Nx graph, shadow output registry or second
1178
- interpolation policy. The record is inside the target's outputs, so a cache hit restores it with them; a live
1179
- developer link (`@smoothbricks/cli`, "Declared Links") checks it to tell a current build from a stale one by content.
1180
- The shell entry that bootstraps the plugin (`tooling/direnv/enter-shell.ts`) keeps its build marker under
1181
- `node_modules/.cache`, not under `outDir`, where the executor would remove it as a file its emit did not write.
1163
+ The emit runs with `--verbose`, whose summary lists every file the emit produced on each of ttsc's lanes (its own
1164
+ host, the direct-tsgo lane, the utility-plugin host and typia's), and after a successful emit the executor removes
1165
+ each file under `outDir` that the list does not name, other than its own `.build-inputs.json`, and each directory that
1166
+ leaves empty. A file an earlier build wrote and this one no longer does (a bin moved to another package, a deleted
1167
+ module) is gone before Nx captures the output, so no cache artifact carries it. A summary that lists no files, or
1168
+ fewer or more than it counts, fails the emit rather than read as one that produced nothing, and a list that names a
1169
+ file the emit did not leave prunes nothing and fails the emit, so Nx caches no output it emptied. Execute bits are set
1170
+ only on a bin that lacks them, since a chmod moves the file's ctime even when its mode stays. A failed emit removes
1171
+ nothing, and an `outDir` that holds a TypeScript source is refused before the compiler runs. It writes
1172
+ `.build-inputs.json` into the `outDir`, only when the record changed: the SHA-256 of every file the config's `include`
1173
+ matches less its `exclude`, taken before the emit, and those globs as Git pathspecs. Native targets write the same
1174
+ record from rustc's dep-info through `@smoothbricks/build-inputs`: macOS uses its `smoo-nx-build-inputs` CLI and
1175
+ Linux's `cargo-zigbuild` executor calls that same collector. A record produced under Nx also carries its producer's
1176
+ project, target and optional configuration, taken from the actual task environment. Shell entry uses that identity to
1177
+ judge the selected development receipts, including inferred targets absent from package manifests, and name their
1178
+ actual cached rebuild. It constructs no Nx graph, shadow output registry or second interpolation policy. The record is
1179
+ inside the target's outputs, so a cache hit restores it with them; a live developer link (`@smoothbricks/cli`,
1180
+ "Declared Links") checks it to tell a current build from a stale one by content. The shell entry that bootstraps the
1181
+ plugin (`tooling/direnv/enter-shell.ts`) keeps its build marker under `node_modules/.cache`, not under `outDir`, where
1182
+ the executor would remove it as a file its emit did not write.
1182
1183
  - `scriptc-<arch>-<family>` (`scriptc-arm64-macos`, `scriptc-x64-macos`, `scriptc-arm64-linux`, `scriptc-x64-linux`) are
1183
1184
  inferred for a package that lists `scriptc` in `devDependencies` (that pin is the compiler the targets run; the
1184
1185
  workspace root lists `scriptc` in `trustedDependencies` so its install links the platform compiler) together with each
@@ -41,7 +41,7 @@
41
41
  "packages/nx-plugin/src/executors/bounded-exec/executor.ts": "49c29558c8b4f3db21a807d6c2e453ca5805ffd8b41f8f79d3837fde33a92396",
42
42
  "packages/nx-plugin/src/executors/bounded-exec/gateway-lease.ts": "f3f73bd92db30e4857f98fb8bd2b9a75b2a5a2a318f094e075ed803c1f9a0117",
43
43
  "packages/nx-plugin/src/executors/bounded-exec/hang-diagnostics.ts": "bcaa9e52384f6c481a9cc2835ba6e8ffe167afa3cb51623fdf8dc3493876f335",
44
- "packages/nx-plugin/src/executors/bounded-exec/host-memory.darwin.ts": "c27868c1240ec9c782f80c7848f5eee1bc59146e3a56a6c8c0fc05bcf82b2931",
44
+ "packages/nx-plugin/src/executors/bounded-exec/host-memory.darwin.ts": "235ea2aaaee024d750ffe8fae5570c04d607b0eeb2fa2f0fc4309812c95692c1",
45
45
  "packages/nx-plugin/src/executors/bounded-exec/host-memory.linux.ts": "d473dc8475066d4914c419b6b803b6937ebb2577348f0dda8f9ed9def60e8584",
46
46
  "packages/nx-plugin/src/executors/bounded-exec/host-memory.ts": "cc7e94023adad2c3645c7a4ba18d07545426ae8d02840a2cf8117494d0915234",
47
47
  "packages/nx-plugin/src/executors/bounded-exec/leaf-peak.ts": "0b1b94992b2cbb9e3759785424ceb202667053c5571edf3a79cdd0b206e54a1d",
@@ -77,7 +77,7 @@
77
77
  "packages/nx-plugin/src/executors/shard-timings/executor.ts": "b5a84156fe2b71022603990a9c3e7721de7995987770b14ae60bd7e8117b1adf",
78
78
  "packages/nx-plugin/src/executors/shard-timings/schema.ts": "e509fc7be7a5752f1636f3006440e747d8381c40a46229627b11d7cdad633f69",
79
79
  "packages/nx-plugin/src/executors/typescript-emit/emit-overrides.ts": "3021aeb756492632d3e5da7a7ae15dded0a9399f73734c0d1fea1c69a2bd4b85",
80
- "packages/nx-plugin/src/executors/typescript-emit/executor.ts": "2084b56a932d418558454d23cb5fa0a7ece86cc8a2f442568dcd8aa8f6cf4d7e",
80
+ "packages/nx-plugin/src/executors/typescript-emit/executor.ts": "318e6b8e90b6e811ecb45158586d4ab481fc40eb72950dc4600d5c065acbae86",
81
81
  "packages/nx-plugin/src/executors/typescript-emit/schema.ts": "20edee20fee80198bbfbb743848d4ac3e41e734050abd511fceafcea9cd6da28",
82
82
  "packages/nx-plugin/src/executors/wrangler-deploy/deploy-hash.ts": "0ebcf8d795e703f98e43e6e89c474f71f8bde0e09a807564480dbc73ce30cd8a",
83
83
  "packages/nx-plugin/src/executors/wrangler-deploy/executor.ts": "de8a8b2c069692b1280b779b48069f7c0cd30cd394c416c821d635130c365a5a",
@@ -1 +1 @@
1
- {"version":3,"file":"host-memory.darwin.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/host-memory.darwin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AAgJrE,eAAO,MAAM,YAAY,EAAE,UAAgF,CAAC"}
1
+ {"version":3,"file":"host-memory.darwin.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/host-memory.darwin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AAqIrE,eAAO,MAAM,YAAY,EAAE,UAAgF,CAAC"}
@@ -1,41 +1,28 @@
1
- import { execFile } from 'node:child_process';
2
- import { promisify } from 'node:util';
1
+ import { totalmem } from 'node:os';
3
2
  /**
4
3
  * macOS's memory mechanisms. A run's memory is the host's, `hw.memsize`: macOS confines no job to a memory limit of
5
4
  * its own. Bun reports a leaf's `ru_maxrss` in bytes, as macOS does.
6
5
  */
7
- const run = promisify(execFile);
8
6
  const HW_MEMSIZE = 'hw.memsize';
9
- async function readRunMemory() {
10
- let stdout;
11
- try {
12
- ({ stdout } = await run('sysctl', ['-n', HW_MEMSIZE]));
13
- }
14
- catch (error) {
15
- return {
16
- ok: false,
17
- error: {
18
- operation: 'read-run-memory',
19
- code: 'unreadable',
20
- subject: HW_MEMSIZE,
21
- cause: error instanceof Error ? error.message : String(error),
22
- },
23
- };
24
- }
25
- const value = stdout.trim();
26
- const bytes = Number(value);
27
- if (!/^\d+$/.test(value) || !Number.isSafeInteger(bytes) || bytes === 0) {
28
- return {
7
+ /**
8
+ * `hw.memsize`, read in this process: `os.totalmem()` is that sysctl under Node (libuv) and Bun alike. A child `sysctl`
9
+ * cost each run a process, and under `bun test` its exit sometimes never settled, so the pool a run serves never
10
+ * started: eight concurrent runs of the pool-silence cases at load ~50 hung there 6 times out of 24.
11
+ */
12
+ function readRunMemory() {
13
+ const bytes = totalmem();
14
+ if (!Number.isSafeInteger(bytes) || bytes <= 0) {
15
+ return Promise.resolve({
29
16
  ok: false,
30
17
  error: {
31
18
  operation: 'read-run-memory',
32
19
  code: 'malformed',
33
20
  subject: HW_MEMSIZE,
34
- cause: `sysctl printed ${JSON.stringify(value)}, not a byte count`,
21
+ cause: `os.totalmem() answered ${String(bytes)}, not a byte count`,
35
22
  },
36
- };
23
+ });
37
24
  }
38
- return { ok: true, memory: { bytes, source: HW_MEMSIZE } };
25
+ return Promise.resolve({ ok: true, memory: { bytes, source: HW_MEMSIZE } });
39
26
  }
40
27
  /**
41
28
  * Bun's FFI, as the peak waiter reaches it. Node, which runs the executor, loads this module too and has no `bun:ffi`;
@@ -31,8 +31,9 @@ export interface VerboseEmit {
31
31
  }
32
32
  /**
33
33
  * Reads the emitted-file list of ttsc's `--verbose` summary. ttsc's own host and its direct-tsgo lane
34
- * (cmd/ttsc/build.go, BuildExecution `verboseBuildSummary`) and a plugin's transform host (typia's
35
- * `ttsc-typia`) all print it in one shape under their own label: a header `// <label>: tsconfig=<config> cwd=<cwd>
34
+ * (cmd/ttsc/build.go, BuildExecution `verboseBuildSummary`), its utility-plugin host (utility/host.go, given the
35
+ * header and list by the managed ttsc patch) and a plugin's own transform host (typia's `ttsc-typia`) all print it
36
+ * in one shape under their own label: a header `// <label>: tsconfig=<config> cwd=<cwd>
36
37
  * … emit=true …`, then `// <label>: emitted=<count> files`, then one ` + <path>` line per file, relative to that
37
38
  * cwd. Pruning trusts this list, so output without one, or a list longer or shorter than its count, is refused rather
38
39
  * than read as an emit that produced nothing.
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/typescript-emit/executor.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,kBAAkB,EASxB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;CAClB;AAQD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACvC;AAED,mHAAmH;AACnH,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,kBAAkB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;AAE1F,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAG/B;AAED,kGAAkG;AAClG,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,cAAc,EACtB,QAAQ,CAAC,EAAE,kBAAkB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAiD/B;AAoKD,sHAAsH;AACtH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAiC3D"}
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/typescript-emit/executor.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,kBAAkB,EASxB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;CAClB;AAQD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACvC;AAED,mHAAmH;AACnH,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,kBAAkB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;AAE1F,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAG/B;AAED,kGAAkG;AAClG,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,cAAc,EACtB,QAAQ,CAAC,EAAE,kBAAkB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAiD/B;AAoKD,sHAAsH;AACtH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAiC3D"}
@@ -203,8 +203,9 @@ const VERBOSE_COUNT = /^\/\/ [^:]+: emitted=(\d+) files$/;
203
203
  const VERBOSE_FILE = /^ {2}\+ (.+)$/;
204
204
  /**
205
205
  * Reads the emitted-file list of ttsc's `--verbose` summary. ttsc's own host and its direct-tsgo lane
206
- * (cmd/ttsc/build.go, BuildExecution `verboseBuildSummary`) and a plugin's transform host (typia's
207
- * `ttsc-typia`) all print it in one shape under their own label: a header `// <label>: tsconfig=<config> cwd=<cwd>
206
+ * (cmd/ttsc/build.go, BuildExecution `verboseBuildSummary`), its utility-plugin host (utility/host.go, given the
207
+ * header and list by the managed ttsc patch) and a plugin's own transform host (typia's `ttsc-typia`) all print it
208
+ * in one shape under their own label: a header `// <label>: tsconfig=<config> cwd=<cwd>
208
209
  * … emit=true …`, then `// <label>: emitted=<count> files`, then one ` + <path>` line per file, relative to that
209
210
  * cwd. Pruning trusts this list, so output without one, or a list longer or shorter than its count, is refused rather
210
211
  * than read as an emit that produced nothing.
@@ -686,3 +686,46 @@ diff --git a/lib/plugin/internal/source/waitForPluginBinary.js b/lib/plugin/inte
686
686
  if (clock - startedAt >= opts.timeoutMs) {
687
687
  throw new Error(`ttsc: timed out after ${(0, formatDuration_1.formatDuration)(clock - startedAt)} waiting for ` +
688
688
  `${opts.lockInfo.label} "${opts.lockInfo.pluginName}" at ${opts.lockDir}; ` +
689
+ diff --git a/utility/host.go b/utility/host.go
690
+ index fab9fcc72897ec54540a5f5e93dfe115bba102a5..9d72bb780e5e104f6a41889a712efe677bdfe3d8 100644
691
+ --- a/utility/host.go
692
+ +++ b/utility/host.go
693
+ @@ -7,6 +7,7 @@ import (
694
+ "io"
695
+ "os"
696
+ "path/filepath"
697
+ + "sort"
698
+ "strings"
699
+
700
+ shimcompiler "github.com/microsoft/typescript-go/shim/compiler"
701
+ @@ -234,7 +235,10 @@ func RunBuildWithIO(args []string, stdout, stderr io.Writer) int {
702
+ opts.quiet = false // --verbose overrides the default --quiet=true
703
+ }
704
+ if !opts.quiet {
705
+ - fmt.Fprintf(opts.stdout, "// ttsc utility: plugins=%d emit=%v\n", len(entries), !opts.noEmit)
706
+ + // The header and the " + <path>" list below are the summary shape ttsc's
707
+ + // build lane (cmd/ttsc/build.go) and ttsc-typia print, so a caller that
708
+ + // reads the emitted files from --verbose reads this lane the same way.
709
+ + fmt.Fprintf(opts.stdout, "// ttsc utility: tsconfig=%s cwd=%s emit=%v plugins=%d\n", opts.tsconfig, opts.cwd, !opts.noEmit, len(entries))
710
+ }
711
+ writeFile, finishPreamble := makeSourcePreambleWriteFile(prog)
712
+ var snapshot func() map[string][]string
713
+ @@ -284,6 +288,18 @@ func RunBuildWithIO(args []string, stdout, stderr io.Writer) int {
714
+ }
715
+ if !opts.quiet {
716
+ fmt.Fprintf(opts.stdout, "// ttsc utility: emitted=%d files\n", len(emittedFiles))
717
+ + listed := make([]string, 0, len(emittedFiles))
718
+ + for fileName := range emittedFiles {
719
+ + listed = append(listed, fileName)
720
+ + }
721
+ + sort.Strings(listed)
722
+ + for _, fileName := range listed {
723
+ + rel := fileName
724
+ + if relative, err := filepath.Rel(opts.cwd, fileName); err == nil {
725
+ + rel = relative
726
+ + }
727
+ + fmt.Fprintln(opts.stdout, " +", rel)
728
+ + }
729
+ }
730
+ return 0
731
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smoothbricks/nx-plugin",
3
- "version": "0.7.9",
3
+ "version": "0.7.10",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "./loader.js",
@@ -474,6 +474,7 @@
474
474
  "^dependencyDefault",
475
475
  "bunToolchain",
476
476
  "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs",
477
+ "{workspaceRoot}/packages/lmao-ttsc/plugin.cjs",
477
478
  {
478
479
  "dependentTasksOutputFiles": "**/test-stream/archive.tar.zst",
479
480
  "transitive": false
@@ -501,6 +502,7 @@
501
502
  "^dependencyDefault",
502
503
  "bunToolchain",
503
504
  "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs",
505
+ "{workspaceRoot}/packages/lmao-ttsc/plugin.cjs",
504
506
  {
505
507
  "dependentTasksOutputFiles": "**/test-stream/archive.tar.zst",
506
508
  "transitive": false
@@ -528,6 +530,7 @@
528
530
  "^dependencyDefault",
529
531
  "bunToolchain",
530
532
  "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs",
533
+ "{workspaceRoot}/packages/lmao-ttsc/plugin.cjs",
531
534
  {
532
535
  "dependentTasksOutputFiles": "**/test-stream/archive.tar.zst",
533
536
  "transitive": false
@@ -555,6 +558,7 @@
555
558
  "^dependencyDefault",
556
559
  "bunToolchain",
557
560
  "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs",
561
+ "{workspaceRoot}/packages/lmao-ttsc/plugin.cjs",
558
562
  {
559
563
  "dependentTasksOutputFiles": "**/test-stream/archive.tar.zst",
560
564
  "transitive": false
@@ -652,7 +656,7 @@
652
656
  "@nx/js": "24.0.3",
653
657
  "@smoothbricks/build-inputs": "0.0.3",
654
658
  "@smoothbricks/cargo-retain": "0.0.2",
655
- "@smoothbricks/cowshed": "0.4.7",
659
+ "@smoothbricks/cowshed": "0.4.8",
656
660
  "@smoothbricks/nextest-extract": "0.0.2",
657
661
  "jsonc-parser": "^3.3.1",
658
662
  "minimatch": "10.2.5",
@@ -665,7 +669,7 @@
665
669
  "yaml": "^2.9.0"
666
670
  },
667
671
  "devDependencies": {
668
- "@smoothbricks/lmao": "0.6.0",
672
+ "@smoothbricks/lmao": "0.6.1",
669
673
  "@smoothbricks/validation": "0.1.13",
670
674
  "fast-check": "^4.4.0"
671
675
  }
@@ -1,5 +1,4 @@
1
- import { execFile } from 'node:child_process';
2
- import { promisify } from 'node:util';
1
+ import { totalmem } from 'node:os';
3
2
  import type { HostMemory, RunMemoryReading } from './host-memory.js';
4
3
 
5
4
  /**
@@ -7,38 +6,27 @@ import type { HostMemory, RunMemoryReading } from './host-memory.js';
7
6
  * its own. Bun reports a leaf's `ru_maxrss` in bytes, as macOS does.
8
7
  */
9
8
 
10
- const run = promisify(execFile);
11
9
  const HW_MEMSIZE = 'hw.memsize';
12
10
 
13
- async function readRunMemory(): Promise<RunMemoryReading> {
14
- let stdout: string;
15
- try {
16
- ({ stdout } = await run('sysctl', ['-n', HW_MEMSIZE]));
17
- } catch (error) {
18
- return {
19
- ok: false,
20
- error: {
21
- operation: 'read-run-memory',
22
- code: 'unreadable',
23
- subject: HW_MEMSIZE,
24
- cause: error instanceof Error ? error.message : String(error),
25
- },
26
- };
27
- }
28
- const value = stdout.trim();
29
- const bytes = Number(value);
30
- if (!/^\d+$/.test(value) || !Number.isSafeInteger(bytes) || bytes === 0) {
31
- return {
11
+ /**
12
+ * `hw.memsize`, read in this process: `os.totalmem()` is that sysctl under Node (libuv) and Bun alike. A child `sysctl`
13
+ * cost each run a process, and under `bun test` its exit sometimes never settled, so the pool a run serves never
14
+ * started: eight concurrent runs of the pool-silence cases at load ~50 hung there 6 times out of 24.
15
+ */
16
+ function readRunMemory(): Promise<RunMemoryReading> {
17
+ const bytes = totalmem();
18
+ if (!Number.isSafeInteger(bytes) || bytes <= 0) {
19
+ return Promise.resolve({
32
20
  ok: false,
33
21
  error: {
34
22
  operation: 'read-run-memory',
35
23
  code: 'malformed',
36
24
  subject: HW_MEMSIZE,
37
- cause: `sysctl printed ${JSON.stringify(value)}, not a byte count`,
25
+ cause: `os.totalmem() answered ${String(bytes)}, not a byte count`,
38
26
  },
39
- };
27
+ });
40
28
  }
41
- return { ok: true, memory: { bytes, source: HW_MEMSIZE } };
29
+ return Promise.resolve({ ok: true, memory: { bytes, source: HW_MEMSIZE } });
42
30
  }
43
31
 
44
32
  /**
@@ -283,8 +283,9 @@ export interface VerboseEmit {
283
283
 
284
284
  /**
285
285
  * Reads the emitted-file list of ttsc's `--verbose` summary. ttsc's own host and its direct-tsgo lane
286
- * (cmd/ttsc/build.go, BuildExecution `verboseBuildSummary`) and a plugin's transform host (typia's
287
- * `ttsc-typia`) all print it in one shape under their own label: a header `// <label>: tsconfig=<config> cwd=<cwd>
286
+ * (cmd/ttsc/build.go, BuildExecution `verboseBuildSummary`), its utility-plugin host (utility/host.go, given the
287
+ * header and list by the managed ttsc patch) and a plugin's own transform host (typia's `ttsc-typia`) all print it
288
+ * in one shape under their own label: a header `// <label>: tsconfig=<config> cwd=<cwd>
288
289
  * … emit=true …`, then `// <label>: emitted=<count> files`, then one ` + <path>` line per file, relative to that
289
290
  * cwd. Pruning trusts this list, so output without one, or a list longer or shorter than its count, is refused rather
290
291
  * than read as an emit that produced nothing.