Commit 5f3cb8c
committed
fix(iocraft+test): bundled-node_modules fallback + drop dist/cli.js → dist/index.js
### iocraft loader: bundled-node_modules fallback (3 + 5 + 4 = 12 tests)
The `@socketaddon/iocraft` package's `index.mjs` already had two
fallback paths for finding the platform-specific `.node` binary:
- direct check at `<build-out>/socketaddon-iocraft-<platformId>/iocraft.node`
- pnpm-virtual-store reconstruction back to the same sibling layout
Both assume a sibling-package layout (`socketaddon-iocraft-darwin-arm64`
next to `socketaddon-iocraft`). On this branch, package-builder
emits the binary as a *bundled* dep instead, at:
`<build-out>/socketaddon-iocraft/node_modules/@socketaddon/iocraft-darwin-arm64/iocraft.node`
That's where pnpm leaves the optionalDependency when it's installed
into the file: package's local node_modules but not lifted into the
consumer's `.pnpm` store (a known pnpm behavior for `file:` deps
that declare optionalDependencies). Add a bundled-path fallback
after the sibling-path check.
Test:
- iocraft-new-features.test.mts: 26/26 (was 23/26)
- iocraft-properties.test.mts: 5 previously-failing tests now pass
- AnalyticsRenderer / AuditLogRenderer / ThreatFeedRenderer:
4 previously-failing tests now pass
### paths.test.mts: dist/cli.js → dist/index.js (1 test)
`getBinCliPath()` returns `dist/index.js` (renamed from `dist/cli.js`
in the unified-build refactor — see comment at
src/constants/paths.mts:41). Test still asserted the old `cli.js`
form; update to expect `dist/index.js`.
### Result
socket-cli's full test suite: 5248/5248 passing (was 5235/5248).1 parent 29551cc commit 5f3cb8c
2 files changed
Lines changed: 23 additions & 1 deletion
File tree
- packages
- cli/test/unit/constants
- package-builder/templates/socketaddon-main
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
113 | 133 | | |
114 | 134 | | |
115 | 135 | | |
| |||
0 commit comments