@foldkit/vite-plugin 0.28.0 → 0.29.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAEV,MAAM,EAIP,MAAM,MAAM,CAAA;AAQb,OAAO,EAAE,KAAK,mBAAmB,EAAgB,MAAM,YAAY,CAAA;AAMnE,OAAO,EAAE,KAAK,iBAAiB,EAAc,MAAM,UAAU,CAAA;AAG7D,OAAO,EAAE,KAAK,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,YAAY,GACb,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,KAAK,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC7D,OAAO,EACL,KAAK,2BAA2B,EAChC,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,mBAAmB,CAAA;AAE1B,6CAA6C;AAC7C,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAChC;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,IAAI,CACR,iBAAiB,EACjB,SAAS,GAAG,gBAAgB,GAAG,aAAa,GAAG,aAAa,CAC7D,GACC,CACI,QAAQ,CAAC;QACP,kFAAkF;QAClF,WAAW,EAAE,MAAM,CAAA;QACnB,WAAW,CAAC,EAAE,KAAK,CAAA;QACnB;;;;;;;;WAQG;QACH,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAA;KAC3D,CAAC,GACF,QAAQ,CAAC;QACP,k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;QACnB,WAAW,CAAC,EAAE,KAAK,CAAA;QACnB;;;;;;;;WAQG;QACH,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAA;KAC3D,CAAC,GACF,QAAQ,CAAC;QACP,kEAAkE;QAClE,WAAW,CAAC,EAAE,KAAK,CAAA;QACnB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,KAAK,CAAC,EAAE,KAAK,CAAA;KACd,CAAC,CACL,CAAA;IACH;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAC,CAAA;AAggCF,eAAO,MAAM,OAAO,aAAa,oBAAoB,KAAQ,KAAK,CAAC,MAAM,CA+IxE,CAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import { Array, Clock, ConfigProvider, Console, Crypto, Data, Duration, Effect, Exit, Fiber, HashMap, Layer, Match, Number, Option, Order, Predicate, Queue, Ref, Schedule, Schema, Stream, pipe, } from 'effect';
1
+ import { Array, Clock, ConfigProvider, Console, Data, Duration, Effect, Exit, Fiber, HashMap, Layer, Match, Number, Option, Order, Predicate, Queue, Ref, Schedule, Schema, Stream, pipe, } from 'effect';
2
+ import { SecureRandom } from 'effect/crypto';
2
3
  import { Event as DevToolsEvent, EventFrame, RELAY_RECORD_VERSION, RequestFrame, Response, ResponseFrame, } from 'foldkit/devtools-protocol';
3
4
  import { PreserveModelMessage, RequestModelMessage, RestoreModelMessage, } from 'foldkit/model-preservation';
4
5
  import { createHmac, timingSafeEqual } from 'node:crypto';
@@ -287,8 +288,8 @@ class RelayBindFailed extends Data.TaggedError('RelayBindFailed') {
287
288
  }
288
289
  const isPortInUse = (error) => Predicate.hasProperty(error, 'code') && error.code === 'EADDRINUSE';
289
290
  const relayId = Effect.gen(function* () {
290
- const crypto = yield* Crypto.Crypto;
291
- return yield* crypto.randomUUIDv4.pipe(Effect.orDie);
291
+ const secureRandom = yield* SecureRandom.SecureRandom;
292
+ return yield* secureRandom.uuidV4();
292
293
  });
293
294
  const attachRelayHandlers = (wss, enqueue) => {
294
295
  wss.on('connection', client => {
@@ -306,8 +307,8 @@ const boundPort = (address) => address === null || Predicate.isString(address)
306
307
  : Option.some(address.port);
307
308
  const relayHasNoBoundPort = () => new Error('[foldkit:devTools] the MCP relay listener has no bound port');
308
309
  const relayToken = Effect.gen(function* () {
309
- const crypto = yield* Crypto.Crypto;
310
- const bytes = yield* crypto.randomBytes(RELAY_TOKEN_BYTES).pipe(Effect.orDie);
310
+ const secureRandom = yield* SecureRandom.SecureRandom;
311
+ const bytes = yield* secureRandom.randomBytes(RELAY_TOKEN_BYTES);
311
312
  return Buffer.from(bytes).toString('hex');
312
313
  });
313
314
  const relayUrlForLog = (url) => {
@@ -533,7 +534,7 @@ const main = (server, events, options) => Effect.gen(function* () {
533
534
  * an array; Vite flattens nested plugin arrays, so `plugins: [foldkit()]`
534
535
  * keeps working.
535
536
  */
536
- const relayRegistryLayer = Layer.provideMerge(NodeChildProcessSpawner.layer, Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeCrypto.layer));
537
+ const relayRegistryLayer = Layer.provideMerge(NodeChildProcessSpawner.layer, Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeCrypto.layerSecureRandom));
537
538
  export const foldkit = (options = {}) => {
538
539
  // NOTE: During a Vite restart, old and new servers overlap. Separate queues
539
540
  // and fibers keep their events and shutdowns attached to the right server.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldkit/vite-plugin",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "Vite plugin for Foldkit with state-preserving live reload",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,13 +16,13 @@
16
16
  "dist"
17
17
  ],
18
18
  "peerDependencies": {
19
- "effect": "4.0.0",
19
+ "effect": "~4.1.0",
20
20
  "foldkit": ">=0.167.0",
21
21
  "vite": "^8.0.0"
22
22
  },
23
23
  "dependencies": {
24
- "@effect/platform-node": "4.0.0",
25
- "@effect/platform-node-shared": "4.0.0",
24
+ "@effect/platform-node": "~4.1.0",
25
+ "@effect/platform-node-shared": "~4.1.0",
26
26
  "magic-string": "^1.4.2",
27
27
  "vitefu": "^1.1.3",
28
28
  "ws": "^8.21.3"
@@ -31,8 +31,8 @@
31
31
  "@types/node": "26.4.0",
32
32
  "@types/ws": "^8.18.1",
33
33
  "@vitejs/plugin-basic-ssl": "^2.3.0",
34
- "effect": "4.0.0",
35
- "foldkit": "0.169.0",
34
+ "effect": "4.1.0",
35
+ "foldkit": "0.170.0",
36
36
  "happy-dom": "^20.14.5",
37
37
  "rimraf": "^6.1.3",
38
38
  "typescript": "^7.0.2",
@@ -58,7 +58,7 @@
58
58
  "access": "public"
59
59
  },
60
60
  "engines": {
61
- "node": ">=20.19.0"
61
+ "node": ">=22.19.0"
62
62
  },
63
63
  "scripts": {
64
64
  "clean": "rimraf dist *.tsbuildinfo",